home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
ZTIMER11.ARJ
/
MAIN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-04-20
|
1KB
|
50 lines
program main;
{ Test of Zen Timer. Timer by Michael Abrash, test by Kendall Bennett. }
{ Translation of main.c into Turbo Pascal by Duncan Murdoch. }
uses ztimer;
procedure ReportTime(count:longint);
begin
writeln('Time taken: ',count/1000000:12:6);
end;
var
i,j : integer; { NON register variables! }
count : longint;
begin
{ Test the precision timer routine }
_PZTimerOn;
for i := 0 to 10000 do
i := i;
_PZTimerOff;
_PZTimerReport;
count := _PZTimerCount;
writeln('Count returned: ',count);
{ Test the precision timer routine for overflow }
_PZTimerOn;
for j := 1 to 20 do
for i := 0 to 10000 do
i := i;
_PZTimerOff;
_PZTimerReport;
count := _PZTimerCount;
writeln('Count returned: ',count);
{ Test the long period Zen Timer (we don't check for overflow coz
it would take tooooo long!)
}
_LZTimerOn;
for j := 1 to 20 do
for i := 0 to 10000 do
i := i;
_LZTimerOff;
_LZTimerReport;
ReportTime(_LZTimerCount);
end.